package com.hengpeng.itfin.persist;

import java.util.Date;

import com.hengpeng.common.persist.NestedSimplyDao;
import com.hengpeng.itfinbase.persist.Account;

/**
 * 资金账户表
 * 
 * @author weiyuan
 *
 */
public interface AccountDao extends NestedSimplyDao<Account> {

    /**
     * 根据用户id获取对应账户
     * 
     * @param userId
     * @return
     */
    public Account getAccountByUserId(Long userId);

    /**
     * 根据用户id和子账户号获取账户信息
     * 
     * @param userId
     * @param subaccountId
     * @return
     */
    public Account getAccountByUserIdAndSub(Long userId, String subaccountId);

    /**
     * 更新账户
     * 
     * @param newAccount
     * @return
     */
    public int updateAccount(Account newAccount);
    
    /**
     * 更新账户
     * 
     * @param baseMoney
     * @param freezeMoney
     * @param totalfillMoney
     * @param totaldrawMoney
     * @param totalInvestMoney
     * @param totalInvestNum
     * @param totalIncomeMoney
     * @param baseMoneyCollect
     * @param inComeMoneyCollect
     * @param baseMoneyRepay
     * @param interestMoneyRepay
     * @param updateTime
     * @param version
     * @param id
     * @param newVersion
     * @return
     */
    public int updateAccount(Long trnas_baseMoney, Long trnas_freezeMoney, Long trnas_totalfillMoney,
            Long trnas_totaldrawMoney, Long trnas_totalInvestMoney, Long trnas_totalInvestNum,
            Long trnas_totalIncomeMoney, Long trnas_baseMoneyCollect, Long trnas_inComeMoneyCollect,
            Long trnas_baseMoneyRepay, Long trnas_interestMoneyRepay, Date updateTime, Long id);

}
